import axios from '@/utils/request';
import { BASE_URL } from '@/api';

export const dictList = (params) => {
	return axios.get(`${BASE_URL}/dict`, { params: params });
};

export const refresh = () => {
	return axios.get(`${BASE_URL}/dict/refresh`);
};

export const addDict = (params) => {
	return axios.post(`${BASE_URL}/dict`, params);
};

export const editDict = (params) => {
	return axios.put(`${BASE_URL}/dict`, params);
};

export const removeDict = (id) => {
	return axios.delete(`${BASE_URL}/dict/${id}`);
};

export const dictDetailList = (params) => {
	return axios.get(`${BASE_URL}/dict/detail`, { params: params });
};

export const addDictDetail = (params) => {
	return axios.post(`${BASE_URL}/dict/detail`, params);
};

export const editDictDetail = (params) => {
	return axios.put(`${BASE_URL}/dict/detail`, params);
};

export const removeDictDetail = (id) => {
	return axios.delete(`${BASE_URL}/dict/detail/${id}`);
};

export const dictCache = () => {
	return axios.get(`${BASE_URL}/dict/cache`);
};
